﻿
//Ctn.Browser = {
//ua:navigator.userAgent.toLowerCase(),
//isIE : function (ver){
//    
//},
//ver : (ua.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1]
//} 
CtnXML = {
    getXmlDoc: function(){//获取XML文档对象
        var xmldoc = null ;
        try
        {
            xmldoc = new ActiveXObject("Msxml2.DOMDocument.4.0") ;
        }
        catch(e)
        {
            try
            {
                xmldoc = new ActiveXObject("Microsoft.XMLDOM") ;
            }
            catch(o)
            {
                if(document.implementation 
                    && document.implementation.createDocument
                    && document.implementation.hasFeature("XPath", "3.0"))
                {
                    xmldoc = document.implementation.createDocument('','',null);
                }
            }
        }
        return {xmldoc:xmldoc,
            loadXML:function(v){
                this.xmldoc.loadXML(v);
                this.root = this.documentElement = this.xmldoc.documentElement;
            },
            selectNodes: function(v)
            {
                return this.xmldoc.selectNodes(v);
            },
            selectSingleNode:function(v)
            {
                return this.xmldoc.selectSingleNode(v);
            }
        };
    }
}
function ie(ver)
{
    ver = ver.toString();
    var a,b,c,l,f;
    a = ver.substring(ver.length - 1);
    if (a == "+" || a == "-")
    {
        b = $.browser.version.split(".");
        ver = ver.substring(0, ver.length - 1);
        c = ver.split(".");
        l = b.length > c.length ?c.length:b.length;
        f = a == "+"?true:false;
        for (var i = 0; i < l; i++)
        {
            if ((f && c[i] > b[i]) || (!f && c[i] < b[i]))
            {
                return false;
            }
        }
        return true;
    }
    else
    {
        return $.browser.version.indexOf(ver) == 0;
    }
}
$(document).ready(init);
function init()
{
    //alert($.browser.version);
    //$("#div1").html($.browser.version);
    var x = CtnXML.getXmlDoc();
    x.loadXML("<xml>sdsd</xml>");
    var n = x.selectSingleNode("xml");
    alert(n.text);
}

var a = new Array();
var b = new String();
b.split("");
var Class = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }
}

var DataGrid = Class.create();
DataGrid.prototype = {
};
var dg = new DataGrid();
